package exercise4;

public class CheckingAccount extends Account {
		private double overdraftProtection;
		CheckingAccount(double balance){
			super(balance);
		}
		CheckingAccount(double balance,double protect){
				super(balance);
				overdraftProtection=protect;
		}
		public boolean withdraw(double amt) {
				if(amt-balance>overdraftProtection) {
					return false;
				}
				else if(amt>balance&&amt-balance<overdraftProtection) {
					balance-=amt;
					balance=0;
					return true;
				}
				else
					balance-=amt;
					return true;
		}
}
